﻿@using Newtonsoft.Json
@model List<IReklamo.SponsoredComplaint>
<div id="divSponsored">
</div>
@{
    var data = JsonConvert.SerializeObject(Model);
}

<script type="text/javascript" src="/Content/jsRender/jsrender.js"></script>
<script type="text/javascript">
    $(function () {
        $('#divSponsored').darylcarousel({ 
            data: @Html.Raw(data),
            thumbTemplateId : 'thumbTemplate',
            previewTemplateId : 'previewTemplate',
            carouselPreviewId: 'carouselPreview',
            carouselThumbsId : 'carouselThumbs',
            carouselTitleId : 'carouselTitle'
        });
    });
</script>

<script id="previewTemplate" type="text/x-jsrender">
    <div id="carouselPreview" class="carouselPreview">
        <div id="carouselTitle"></div>
        <div style="margin:auto;height:200px;max-height:200px;text-align:center">
            <img style="max-width:100%; max-height:100%;" />
        </div>
        <div class="carouselContent"></div>
    </div>
</script>

<script id="thumbTemplate" type="text/x-jsrender">
<div id="carouselThumbs" class="carouselThumbs" style="display: inline-block; padding: 5px;width:100px;">
    <div>{{>TeaserTitle}}</div>
    <img src="{{>Visuals[0].ThumbFile}}" style="max-width:100%; max-height:100%" />
</div>
</script>
